Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.JSlider
setMajorTickSpacing
and setMinorTickSpacing
.
For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JSlider key assignments.
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner Class Summary | |
JSlider.AccessibleJSlider
The class used to obtain the accessible role for this object. |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Field Summary | |
ChangeEvent | changeEvent
Only one ChangeEvent is needed per slider instance since the event's only (read-only) state is the source property. |
ChangeListener | changeListener
The changeListener (no suffix) is the listener we add to the Sliders model. |
int | majorTickSpacing
The number of pixels between the major tick marks -- the larger marks that break up the minor tick marks. |
int | minorTickSpacing
The number of pixels between the minor tick marks -- the smaller marks that occur between the major tick marks. |
int | orientation
|
BoundedRangeModel | sliderModel
The data model that handles the numeric maximum value, minimum value, and current-position value for the slider. |
boolean | snapToTicks
If true, the knob (and the data value it represents) resolve to the closest tick mark next to where the user positioned the knob. |
Fields inherited from class com.sun.java.swing.JComponent | |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
JSlider(int orientation,
int min,
int max,
int value)
Creates a slider with the specified orientation and the specified mimimum, maximum, and initial values. |
|
JSlider()
Creates a horizontal slider with the range 0 to 100 and an intitial value of 50. |
Method Summary | |
void | addChangeListener(ChangeListener l)
Adds a ChangeListener to the slider. |
ChangeListener | createChangeListener()
Subclasses that want to handle model ChangeEvents differently can override this method to return their own ChangeListener implementation. |
java.util.Hashtable | createStandardLabels(int increment)
Creates a hashtable that will draw text labels starting at the slider minimum using the increment specified. |
java.util.Hashtable | createStandardLabels(int increment,
int start)
Creates a hashtable that will draw text labels starting at the start point specified using the increment specified. |
void | fireStateChanged()
Send a ChangeEvent, whose source is this Slider, to each listener. |
AccessibleContext | getAccessibleContext()
Get the AccessibleContext associated with this JComponent |
int | getExtent()
|
boolean | getInverted()
Returns true if the value-range shown for the slider is reversed, with the maximum value at the left end of a horizontal slider or at the bottom of a vertical one. |
java.util.Dictionary | getLabelTable()
Returns the dictionary of what labels to draw at which values. |
int | getMajorTickSpacing()
|
int | getMaximum()
Returns the maximum value supported by the slider. |
int | getMinimum()
Returns the minimum value supported by the slider. |
int | getMinorTickSpacing()
|
BoundedRangeModel | getModel()
Returns data model that handles the sliders three fundamental properties: minimum, maximum, value. |
int | getOrientation()
|
boolean | getPaintLabels()
|
boolean | getPaintTicks()
|
boolean | getSnapToTicks()
Returns true if the knob (and the data value it represents) resolve to the closest tick mark next to where the user positioned the knob. |
java.lang.String | getUIClassID()
Returns the name of the L&F class that renders this component. |
com.sun.java.swing.plaf.SliderUI | getUI()
Gets the UI object which implements the L&F for this component. |
boolean | getValueIsAdjusting()
True if the slider knob is being dragged. |
int | getValue()
Returns the sliders value. |
void | removeChangeListener(ChangeListener l)
Removes a ChangeListener from the slider. |
void | setExtent(int extent)
Sets the size of the range "covered" by the knob. |
void | setInverted(boolean b)
Specify true to reverse the value-range shown for the slider so that the maximum value is at the left end of a horizontal slider or at the bottom of a vertical one. |
void | setLabelTable(java.util.Dictionary labels)
Used to specify what label will be drawn at any given value. |
void | setMajorTickSpacing(int n)
Sets the number of pixels between major tick marks. |
void | setMaximum(int maximum)
Sets the models maximum property. |
void | setMinimum(int minimum)
Sets the models minimum property. |
void | setMinorTickSpacing(int n)
Sets the number of pixels between minor tick marks. |
void | setModel(BoundedRangeModel newModel)
Sets the model that handles the sliders three fundamental properties: minimum, maximum, value. |
void | setOrientation(int orientation)
Set the scrollbars orientation to either VERTICAL or HORIZONTAL. |
void | setPaintLabels(boolean b)
Determines whether labels are painted on the slider. |
void | setPaintTicks(boolean b)
Determines whether tick marks are painted on the slider. |
void | setSnapToTicks(boolean b)
Specifying true makes the knob (and the data value it represents) resolve to the closest tick mark next to where the user positioned the knob. |
void | setUI(com.sun.java.swing.plaf.SliderUI ui)
Sets the UI object which implements the L&F for this component. |
void | setValueIsAdjusting(boolean b)
Sets the models valueIsAdjusting property. |
void | setValue(int n)
Sets the sliders current value. |
java.lang.String | toString()
Returns a string containing that displays and identifies this object's propeties. |
void | updateLabelUIs()
Called internally to replace the label UIs with the latest versions from the UIFactory when the UIFactory notifies us via updateUI that the L&F has changed. |
void | updateUI()
Notification from the UIFactory that the L&F has changed. |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected BoundedRangeModel sliderModel
protected int majorTickSpacing
protected int minorTickSpacing
protected boolean snapToTicks
protected int orientation
protected ChangeListener changeListener
protected transient ChangeEvent changeEvent
Constructor Detail |
public JSlider(int orientation, int min, int max, int value)
public JSlider()
Method Detail |
public com.sun.java.swing.plaf.SliderUI getUI()
public void setUI(com.sun.java.swing.plaf.SliderUI ui)
ui
- the SliderUI L&F objectpublic void updateUI()
public java.lang.String getUIClassID()
protected ChangeListener createChangeListener()
public void addChangeListener(ChangeListener l)
l
- the ChangeListener to addpublic void removeChangeListener(ChangeListener l)
l
- the ChangeListener to removeprotected void fireStateChanged()
public BoundedRangeModel getModel()
public void setModel(BoundedRangeModel newModel)
public int getValue()
public void setValue(int n)
public int getMinimum()
public void setMinimum(int minimum)
public int getMaximum()
public void setMaximum(int maximum)
public boolean getValueIsAdjusting()
public void setValueIsAdjusting(boolean b)
public int getExtent()
public void setExtent(int extent)
public int getOrientation()
public void setOrientation(int orientation)
public java.util.Dictionary getLabelTable()
public void setLabelTable(java.util.Dictionary labels)
protected void updateLabelUIs()
updateUI
that the L&F has changed.public java.util.Hashtable createStandardLabels(int increment)
public java.util.Hashtable createStandardLabels(int increment, int start)
public boolean getInverted()
public void setInverted(boolean b)
b
- true to reverse the slider values from their normal orderpublic int getMajorTickSpacing()
public void setMajorTickSpacing(int n)
public int getMinorTickSpacing()
public void setMinorTickSpacing(int n)
public boolean getSnapToTicks()
public void setSnapToTicks(boolean b)
b
- true to snap the knob to the nearest tick markpublic boolean getPaintTicks()
public void setPaintTicks(boolean b)
public boolean getPaintLabels()
public void setPaintLabels(boolean b)
public java.lang.String toString()
public AccessibleContext getAccessibleContext()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |